package com.longxi.tianjintianbao.ui.activity.main;

import android.webkit.WebView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.main.BrowserAtPresenter;
import com.longxi.tianjintianbao.ui.view.main.IBrowserAtView;

import butterknife.BindView;

/**
 * Created by cxw on 2018/2/21.
 */

public class BrowserActivity extends BaseActivity<IBrowserAtView, BrowserAtPresenter> implements IBrowserAtView {
    @BindView(R.id.webView)
    WebView mWebView;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_browser;
    }

    @Override
    public void initData() {
        setIvLeft(R.mipmap.icon_close);
        mIvLeft.setOnClickListener(v -> finish());
        mPresenter.getData();
    }

    @Override
    protected BrowserAtPresenter createPresenter() {
        return new BrowserAtPresenter(this);
    }

    @Override
    public WebView getWebView() {
        return mWebView;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mWebView.destroy();
        mWebView = null;
    }
}
